package cn.wolfcode.wolf2w.common.redis.util;


import lombok.Getter;
import lombok.NoArgsConstructor;
//枚举，不能修改，和常量一致
@Getter
@NoArgsConstructor
public enum RedisKeys {
    BRUSH("brush",60L),
    //用户的key
    USER_STRATEGY_THUMBSUP("user_strategy_thumbsup",-1L),

    //存储当前用户收藏信息
    USER_STRATEGY_FAVOR("user_strategy_favor",-1L),
    //枚举
    STRATEGY_STATIS_HASH("strategy_statis_hash",-1L),
    VERIFY_CODE("verify_code",Consts.VERIFY_CODE_TIME*60L);

    private String prefix; //前缀
    private Long time;  //过期时间

    //构造方法
    private RedisKeys(String prefix,Long time){
        this.prefix = prefix;
        this.time = time;
    }

    //可变参数
    public String join(String...  values){

        StringBuffer sb = new StringBuffer();
        sb.append(this.prefix);//平前坠
        for (String val : values){

            sb.append(":").append(val);
        }
        return sb.toString();

    }






}
